import { delWarrantyCategoryByIds } from '@/api/order'
import { ref } from 'vue'

/**
 * 质保类别删除
 */
export default () => {
  // 删除加载
  const delLoading = ref(false)

  /**
   * 删除
   * @param ids - 质保类别id集合
   */
  const del = async (ids: Array<string>) => {
    delLoading.value = true
    const res = await delWarrantyCategoryByIds(ids)
    delLoading.value = false
    return res.data
  }

  return {
    delLoading,
    del,
  }
}
